package com.yichat.micro.msghttpservice.exception;

import com.yichat.micro.msghttpservice.common.result.HttpResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Created by chenmohan on 2019/04/03
 *
 * @description
 */
@RestControllerAdvice
public class GlobalExcpeitonInterceptor {

    @ExceptionHandler(IllegalParameterException.class)
    public Object defaultExceptionHandler(IllegalParameterException e) {
        return HttpResult.fail(e.getCode(), e.getMsg(), e.getExtra());
    }

}
